package org.jeecg.modules.demo.crm.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.annotation.*;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.demo.crm.annotation.FileField;
import org.jeecg.modules.demo.crm.annotation.TitleField;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 收票登记
 * @Author: jeecg-boot
 * @Date:   2025-06-14
 * @Version: V1.0
 */
@Data
@TableName("c_payment_invoice")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="c_payment_invoice对象", description="收票登记")
public class CPaymentInvoice implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**申请id*/
	@Excel(name = "申请id", width = 15)
    @ApiModelProperty(value = "申请id")
    private String request;
	/**项目ID*/
	@Excel(name = "项目ID", width = 15, dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
	@Dict(dictTable = "c_project_application", dicText = "project_name", dicCode = "id")
    @ApiModelProperty(value = "项目ID")
    private String projectId;
	/**子项目ID*/
	@Excel(name = "子项目ID", width = 15, dictTable = "c_sub_project", dicText = "sub_project_name", dicCode = "id")
	@Dict(dictTable = "c_sub_project", dicText = "sub_project_name", dicCode = "id")
    @ApiModelProperty(value = "子项目ID")
    private String subProjectId;

    /**总包id*/
    @Excel(name = "总包id", width = 15, dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @Dict(dictTable = "c_company_info", dicText = "company_name", dicCode = "id")
    @ApiModelProperty(value = "总包id")
    private String companyInfoId;
	/**删除标识*/
	@Excel(name = "删除标识", width = 15)
    @ApiModelProperty(value = "删除标识")
    @TableLogic
    private Integer delFlag;
	/**发票文件*/
	@Excel(name = "发票文件", width = 15)
    @ApiModelProperty(value = "发票文件")
    @FileField // AOP 监听文件数据，存入文件表
    private String invoiceFile;
	/**状态(审核中，入库)*/
	@Excel(name = "状态", width = 15)
    @ApiModelProperty(value = "状态")
    private String invoiceStatus;
	/**项目名称*/
	@Excel(name = "项目名称", width = 15)
    @ApiModelProperty(value = "项目名称")
    private String projectName;
	/**税额*/
	@Excel(name = "税额", width = 15)
    @ApiModelProperty(value = "税额")
    private BigDecimal taxAmount;
	/**开票日期*/
	@Excel(name = "开票日期", width = 15, format = "yyyy-MM-dd")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "开票日期")
    private Date invoiceDate;
	/**开票人*/
	@Excel(name = "开票人", width = 15)
    @ApiModelProperty(value = "开票人")
    private String invoicer;
	/**发票类型*/
	@Excel(name = "发票类型", width = 15)
    @ApiModelProperty(value = "发票类型")
    private String invoiceType;
	/**价税合计（小写）*/
	@Excel(name = "价税合计（小写）", width = 15)
    @ApiModelProperty(value = "价税合计（小写）")
    private BigDecimal totalAmountWithTax;
	/**税率/征收率*/
	@Excel(name = "税率/征收率", width = 15)
    @ApiModelProperty(value = "税率/征收率")
    private BigDecimal taxRate;
	/**价税合计（大写）*/
	@Excel(name = "价税合计（大写）", width = 15)
    @ApiModelProperty(value = "价税合计（大写）")
    private String totalAmountWithTaxUpper;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remarks;
	/**发票号码*/
	@Excel(name = "发票号码", width = 15)
    @ApiModelProperty(value = "发票号码")
    private String invoiceNumber;
	/**金额*/
	@Excel(name = "金额", width = 15)
    @ApiModelProperty(value = "金额")
    private BigDecimal amount;
	/**销售方名称*/
	@Excel(name = "销售方名称", width = 15)
    @ApiModelProperty(value = "销售方名称")
    private String sellerName;
	/**销售方统一社会信用代码/纳税人识别号*/
	@Excel(name = "销售方统一社会信用代码/纳税人识别号", width = 15)
    @ApiModelProperty(value = "销售方统一社会信用代码/纳税人识别号")
    private String sellerTaxId;
	/**购买方名称*/
	@Excel(name = "购买方名称", width = 15)
    @ApiModelProperty(value = "购买方名称")
    private String buyName;
	/**购买方统一社会信用代码/纳税人识别号*/
	@Excel(name = "购买方统一社会信用代码/纳税人识别号", width = 15)
    @ApiModelProperty(value = "购买方统一社会信用代码/纳税人识别号")
    private String buyTaxId;

    @Excel(name = "可以拆票的金额", width = 15)
    @ApiModelProperty(value = "可以拆票的金额")
    private BigDecimal splitAmount;

    @Excel(name = "标题", width = 15)
    @ApiModelProperty(value = "标题")
    @TitleField // AOP 监听文件数据，存入文件表
    private String title;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private BigDecimal highestSplitAmount;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "临时数据字段，不存储到数据库")
    private BigDecimal splitAmountNot;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "收款情况")
    private BigDecimal payment;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "付款记录")
    private List<CPaymentRequest> requestList;

    // 提交新增字段，用于存储临时数据，不映射到数据库
    @TableField(exist = false)
    @ApiModelProperty(value = "项目编号")
    private String projectNumber;




}
